Skip to content

Callback query and inline keyboards support#83

Closed
MarcoBuster wants to merge 3 commits intopython-botogram:masterfrom
MarcoBuster:callback
Closed

Callback query and inline keyboards support#83
MarcoBuster wants to merge 3 commits intopython-botogram:masterfrom
MarcoBuster:callback

Conversation

@MarcoBuster
Copy link
Copy Markdown
Member

I'm adding callback query and inline keyboards support, according to #66.

botogram.objects.callback_query
Representation of the callback query-related upstream API objects

Copyright (c) 2015 Pietro Albini <pietro@pietroalbini.io>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be you, not me, and we're not in 2015.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But it's your work 🥇

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did nothing on that file: the copyright notice should be of the single file, not of the whole project, and you're the author of that file :)

"channel_post": Message,
"edited_channel_post": Message
"edited_channel_post": Message,
"callback_query": CallbackQuery
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a trailing comma here so you don't need to change two lines the next time you want to add a value :)

This class represents a callback query object.
.. py:attribute:: id

Unique identifier for the query
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*of the callback


.. py:attribute:: sender

The :py:class:`~botogram.User` that sends the callback query
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*that sent


.. py:attribute:: message

:py:class:`~botogram.Message` with the callback button that originated the query.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't add dots at the end only in some snippets, add them everywhere or nowhere.

@MarcoBuster MarcoBuster force-pushed the callback branch 2 times, most recently from 19c48d8 to f5c655a Compare May 7, 2017 15:29
Copy link
Copy Markdown
Contributor

@emilyalbini emilyalbini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the documentation for @bot.callback and Component.add_callback_hook is missing.

.. py:class:: botogram.CallbackQuery

This class represents a callback query received by the bot.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot the version this is added to.

hook = hooks.EditedChannelPostHook(func, self)
self.__channel_post_edited_hooks.append(hook)

def add_callback_query_hook(self, func):
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename this to add_callback_hook to be consistent with @bot.callback?

@emilyalbini
Copy link
Copy Markdown
Contributor

I'm implementing a more advanced version of this by myself. Thanks for sending the pull request though!

@emilyalbini emilyalbini closed this Jul 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants